(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

admit(x, nil) → nil
admit(x, .(u, .(v, .(w, z)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z)))))
cond(true, y) → y

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

admit(x, nil) → nil [1]
admit(x, .(u, .(v, .(w, z)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1]
cond(true, y) → y [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

admit(x, nil) → nil [1]
admit(x, .(u, .(v, .(w, z)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1]
cond(true, y) → y [1]

The TRS has the following type information:
admit :: carry → nil:. → nil:.
nil :: nil:.
. :: w → nil:. → nil:.
w :: w
cond :: =:true → nil:. → nil:.
= :: sum → w → =:true
sum :: carry → w → w → sum
carry :: carry → w → w → carry
true :: =:true

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:
none

(c) The following functions are completely defined:


admit
cond

Due to the following rules being added:

admit(v0, v1) → nil [0]
cond(v0, v1) → nil [0]

And the following fresh constants:

const, const1

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

admit(x, nil) → nil [1]
admit(x, .(u, .(v, .(w, z)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, admit(carry(x, u, v), z))))) [1]
cond(true, y) → y [1]
admit(v0, v1) → nil [0]
cond(v0, v1) → nil [0]

The TRS has the following type information:
admit :: carry → nil:. → nil:.
nil :: nil:.
. :: w → nil:. → nil:.
w :: w
cond :: =:true → nil:. → nil:.
= :: sum → w → =:true
sum :: carry → w → w → sum
carry :: carry → w → w → carry
true :: =:true
const :: carry
const1 :: sum

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

admit(x, nil) → nil [1]
admit(x, .(u, .(v, .(w, nil)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, nil)))) [2]
admit(x, .(u, .(v, .(w, .(u', .(v', .(w, z'))))))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, cond(=(sum(carry(x, u, v), u', v'), w), .(u', .(v', .(w, admit(carry(carry(x, u, v), u', v'), z'))))))))) [2]
admit(x, .(u, .(v, .(w, z)))) → cond(=(sum(x, u, v), w), .(u, .(v, .(w, nil)))) [1]
cond(true, y) → y [1]
admit(v0, v1) → nil [0]
cond(v0, v1) → nil [0]

The TRS has the following type information:
admit :: carry → nil:. → nil:.
nil :: nil:.
. :: w → nil:. → nil:.
w :: w
cond :: =:true → nil:. → nil:.
= :: sum → w → =:true
sum :: carry → w → w → sum
carry :: carry → w → w → carry
true :: =:true
const :: carry
const1 :: sum

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

nil => 0
w => 0
true => 0
const => 0
const1 => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + x + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + x + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + x + u + v) + u' + v', z'))))))) :|: v >= 0, x >= 0, z' >= 0, u' >= 0, v' >= 0, z'' = x, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 2 }→ cond(1 + (1 + x + u + v) + 0, 1 + u + (1 + v + (1 + 0 + 0))) :|: v >= 0, x >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), z'' = x, u >= 0
admit(z'', z1) -{ 1 }→ cond(1 + (1 + x + u + v) + 0, 1 + u + (1 + v + (1 + 0 + 0))) :|: v >= 0, z >= 0, x >= 0, z'' = x, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, x >= 0, z'' = x
admit(z'', z1) -{ 0 }→ 0 :|: z'' = v0, v0 >= 0, z1 = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ y :|: z'' = 0, z1 = y, y >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' = v0, v0 >= 0, z1 = v1, v1 >= 0

(11) InliningProof (UPPER BOUND(ID) transformation)

Inlined the following terminating rules on right-hand sides where appropriate:

cond(z'', z1) -{ 1 }→ y :|: z'' = 0, z1 = y, y >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' = v0, v0 >= 0, z1 = v1, v1 >= 0

(12) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + x + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + x + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + x + u + v) + u' + v', z'))))))) :|: v >= 0, x >= 0, z' >= 0, u' >= 0, v' >= 0, z'' = x, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, x >= 0, z'' = x
admit(z'', z1) -{ 0 }→ 0 :|: z'' = v0, v0 >= 0, z1 = v1, v1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, x >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), z'' = x, u >= 0, 1 + (1 + x + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, x >= 0, z'' = x, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + x + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ y :|: z'' = 0, z1 = y, y >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' = v0, v0 >= 0, z1 = v1, v1 >= 0

(13) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(14) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

(15) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ cond }
{ admit }

(16) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed: {cond}, {admit}

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: cond
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z1

(18) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed: {cond}, {admit}
Previous analysis results are:
cond: runtime: ?, size: O(n1) [z1]

(19) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: cond
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(20) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed: {admit}
Previous analysis results are:
cond: runtime: O(1) [1], size: O(n1) [z1]

(21) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(22) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed: {admit}
Previous analysis results are:
cond: runtime: O(1) [1], size: O(n1) [z1]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: admit
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z1

(24) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed: {admit}
Previous analysis results are:
cond: runtime: O(1) [1], size: O(n1) [z1]
admit: runtime: ?, size: O(n1) [z1]

(25) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: admit
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + 4·z1

(26) Obligation:

Complexity RNTS consisting of the following rules:

admit(z'', z1) -{ 2 }→ cond(1 + (1 + z'' + u + v) + 0, 1 + u + (1 + v + (1 + 0 + cond(1 + (1 + (1 + z'' + u + v) + u' + v') + 0, 1 + u' + (1 + v' + (1 + 0 + admit(1 + (1 + z'' + u + v) + u' + v', z'))))))) :|: v >= 0, z'' >= 0, z' >= 0, u' >= 0, v' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + (1 + u' + (1 + v' + (1 + 0 + z'))))), u >= 0
admit(z'', z1) -{ 1 }→ 0 :|: z1 = 0, z'' >= 0
admit(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0
admit(z'', z1) -{ 2 }→ 0 :|: v >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + 0)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
admit(z'', z1) -{ 1 }→ 0 :|: v >= 0, z >= 0, z'' >= 0, z1 = 1 + u + (1 + v + (1 + 0 + z)), u >= 0, 1 + (1 + z'' + u + v) + 0 = v0, v0 >= 0, 1 + u + (1 + v + (1 + 0 + 0)) = v1, v1 >= 0
cond(z'', z1) -{ 1 }→ z1 :|: z'' = 0, z1 >= 0
cond(z'', z1) -{ 0 }→ 0 :|: z'' >= 0, z1 >= 0

Function symbols to be analyzed:
Previous analysis results are:
cond: runtime: O(1) [1], size: O(n1) [z1]
admit: runtime: O(n1) [2 + 4·z1], size: O(n1) [z1]

(27) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(28) BOUNDS(1, n^1)